import { RouteRecordRaw } from 'vue-router'
import { RouterTransition } from '@/components/transition'

const routeName = 'system'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/system',
    name: routeName,
    redirect: '/system/menu',
    component: RouterTransition,
    meta: {
      title: '系统设置',
      icon: 'icon-setting'
    },
    children: [{
      path: 'menu',
      name: `${routeName}-menu`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/menu/menu.vue'),
      meta: {
        title: '菜单管理',
      },
    },
    {
      path: 'menudetail',
      name: `${routeName}-menudetail`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/menu/menu-detail.vue'),
      meta: {
        title: '菜单管理详情',
        hidden: true
      },
    },
    {
      path: 'account',
      name: `${routeName}-account`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/account/account.vue'),
      meta: {
        title: '账户管理',
      },
    },
    {
      path: 'accountdetail',
      name: `${routeName}-account-detail`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/account/account-detail.vue'),
      meta: {
        title: '账户管理详情',
        hidden: true
      },
    },
    {
      path: 'role',
      name: `${routeName}-role`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/role/role.vue'),
      meta: {
        title: '角色管理',
      },
    },
    {
      path: 'roledetail',
      name: `${routeName}-roledetail`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/role/role-detail.vue'),
      meta: {
        title: '角色管理详情',
        hidden: true
      },
    },
    {
      path: 'notice',
      name: `${routeName}-notice`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/notice/notice.vue'),
      meta: {
        title: '通知管理',
      },
    },
    {
      path: 'noticedetail',
      name: `${routeName}-noticedetail`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/notice/notice-detail.vue'),
      meta: {
        title: '通知管理',
        hidden: true
      },
    }, {
      path: 'activation',
      name: `${routeName}-activation`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/system/activation/activation.vue'),
      meta: {
        title: '账号激活申请',
      },
    }]
  }
]

export default routes
